<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Miniappsbeian extends Model
{
    protected $table = 'miniapps_beian';
    protected $primaryKey = 'id';

    public static function insertMiniappBeian($appid,$beian_info)
    {
        return self::insert(["appid"=>$appid,"beian_info"=>$beian_info,"status"=>1,"created_at"=>time()]);
    }

    public static function updateMiniappBeianStatus($appid,$status)
    {
        return self::where('appid',$appid)->update(["status"=>$status]);
    }

    public static function updateMiniappBeian($appid,$beian_info)
    {
        return self::where('appid',$appid)->update(["beian_info"=>$beian_info]);
    }

    public static function getMiniappBeian($appid)
    {
        return self::where('appid',$appid)->orderBy("id","DESC")->first();
    }
}
